﻿using Microsoft.EntityFrameworkCore;
using ST.Buz.Base.Entity;
using ST.Buz.Base.Mapping;

namespace ST.Buz.Base
{
	public partial class BuzContext
	{
		#region 实体
		public virtual DbSet<Sys_Area> SysArea { get; set; }
		public virtual DbSet<Sys_Attachment> SysAttachment { get; set; }
		public virtual DbSet<Sys_AuditLog> SysAuditLog { get; set; }
		public virtual DbSet<Sys_BuzRowNum> SysBuzRowNum { get; set; }
		public virtual DbSet<Sys_Dept> SysDept { get; set; }
		public virtual DbSet<Sys_Duty> SysDuty { get; set; }
		public virtual DbSet<Sys_EnumCode> SysEnumCode { get; set; }
		public virtual DbSet<Sys_Express> SysExpress { get; set; }
		public virtual DbSet<Sys_Invoice> SysInvoice { get; set; }
		public virtual DbSet<Sys_Log> SysLog { get; set; }
		public virtual DbSet<Sys_Module> SysModule { get; set; }
		public virtual DbSet<Sys_ModuleAction> SysModuleAction { get; set; }
		public virtual DbSet<Sys_ModuleService> SysModuleService { get; set; }
		public virtual DbSet<Sys_OAuth> SysOAuth { get; set; }
		public virtual DbSet<Sys_Organization> SysOrganization { get; set; }
		public virtual DbSet<Sys_Role> SysRole { get; set; }
		public virtual DbSet<Sys_RoleAction> SysRoleAction { get; set; }
		public virtual DbSet<Sys_Session> SysSession { get; set; }
		public virtual DbSet<Sys_SmsLog> SysSmsLog { get; set; }
		public virtual DbSet<Sys_TableLog> SysTableLog { get; set; }
		public virtual DbSet<Sys_User> SysUser { get; set; }
		public virtual DbSet<Sys_UserAddress> SysUserAddress { get; set; }
		public virtual DbSet<Sys_UserBankCard> SysUserBankCard { get; set; }
		public virtual DbSet<Sys_UserOAuth> SysUserOAuth { get; set; }
		public virtual DbSet<Sys_UserRole> SysUserRole { get; set; }

		/// <summary>
		/// 微信应用配置
		/// </summary>
		public virtual DbSet<WX_AppConfig> WXAppConfig { get; set; }
		/// <summary>
		/// 微信相关日志
		/// </summary>
		public virtual DbSet<WX_Log> WXLog { get; set; }
		/// <summary>
		/// 微信菜单
		/// </summary>
		public virtual DbSet<WX_Menu> WXMenu { get; set; }
		/// <summary>
		/// 微信相关日志
		/// </summary>
		public virtual DbSet<WX_PayOrder> WXPayOrder { get; set; }
		/// <summary>
		/// 微信formid等信息
		/// </summary>
		public virtual DbSet<WX_Session> WXSession { get; set; }
		/// <summary>
		/// 微信模板消息配置
		/// </summary>
		public virtual DbSet<WX_TplMsgConfig> WXTplMsgConfig { get; set; }
		/// <summary>
		/// 微信模板消息发送日志
		/// </summary>
		public virtual DbSet<WX_TplMsgLog> WXTplMsgLog { get; set; }
		#endregion

		protected void OnModelCreatingSys(ModelBuilder modelBuilder)
		{
#if DEBUG
			#region 系统相关
			modelBuilder.ApplyConfiguration(new Map_Sys_Area());
			modelBuilder.ApplyConfiguration(new Map_Sys_Attachment());
			modelBuilder.ApplyConfiguration(new Map_Sys_AuditLog());
			modelBuilder.ApplyConfiguration(new Map_Sys_BuzRowNum());
			modelBuilder.ApplyConfiguration(new Map_Sys_Dept());
			modelBuilder.ApplyConfiguration(new Map_Sys_Duty());
			modelBuilder.ApplyConfiguration(new Map_Sys_EnumCode());
			modelBuilder.ApplyConfiguration(new Map_Sys_Express());
			modelBuilder.ApplyConfiguration(new Map_Sys_Invoice());
			modelBuilder.ApplyConfiguration(new Map_Sys_Log());
			modelBuilder.ApplyConfiguration(new Map_Sys_Module());
			modelBuilder.ApplyConfiguration(new Map_Sys_ModuleAction());
			modelBuilder.ApplyConfiguration(new Map_Sys_ModuleService());
			modelBuilder.ApplyConfiguration(new Map_Sys_OAuth());
			modelBuilder.ApplyConfiguration(new Map_Sys_Organization());
			modelBuilder.ApplyConfiguration(new Map_Sys_RoleAction());
			modelBuilder.ApplyConfiguration(new Map_Sys_Role());
			modelBuilder.ApplyConfiguration(new Map_Sys_Session());
			modelBuilder.ApplyConfiguration(new Map_Sys_SmsLog());
			modelBuilder.ApplyConfiguration(new Map_Sys_TableLog());
			modelBuilder.ApplyConfiguration(new Map_Sys_UserAddress());
			modelBuilder.ApplyConfiguration(new Map_Sys_UserBankCard());
			modelBuilder.ApplyConfiguration(new Map_Sys_User());
			modelBuilder.ApplyConfiguration(new Map_Sys_UserOAuth());
			modelBuilder.ApplyConfiguration(new Map_Sys_UserRole());

			modelBuilder.ApplyConfiguration(new Map_WX_AppConfig());
			modelBuilder.ApplyConfiguration(new Map_WX_Log());
			modelBuilder.ApplyConfiguration(new Map_WX_Menu());
			modelBuilder.ApplyConfiguration(new Map_WX_Session());
			modelBuilder.ApplyConfiguration(new Map_WX_TplMsgConfig());
			modelBuilder.ApplyConfiguration(new Map_WX_TplMsgLog());
			#endregion
#endif
		}
	}
}
